﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeFile="member_detail.aspx.cs" Inherits="member_detail" %>

<%@ Register Assembly="WuDada.Web" Namespace="WuDada.Web.UI" TagPrefix="cc1" %>
<%@ Register Src="UserControl/MemberMenu.ascx" TagName="MemberMenu" TagPrefix="uc1" %>
<%@ Register Src="UserControl/Bank.ascx" TagName="Bank" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link href="css/NewCss.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery.twzipcode-1.6.0.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(init);

        //網頁上所有的DOM都載入後
        function init() {
            $('#zip1').twzipcode({
                onCountySelect: function () {
                    setTxtValue($(this), 'ctl00_ContentPlaceHolder2_txtCity');
                },
                onDistrictSelect: function () {
                    setTxtValue($(this), 'ctl00_ContentPlaceHolder2_txtArea');
                },
                css: ['county', 'district', 'zip1']
            });
            $('#zip2').twzipcode({
                onCountySelect: function () {
                    setTxtValue($(this), 'ctl00_ContentPlaceHolder2_txtCompanyCity');
                },
                onDistrictSelect: function () {
                    setTxtValue($(this), 'ctl00_ContentPlaceHolder2_txtCompanyArea');
                },
                css: ['county', 'district', 'zip1']
            });

            setDdlValue('ctl00_ContentPlaceHolder2_txtCity', $('#zip1 .county option:selected'));
            setDdlValue('ctl00_ContentPlaceHolder2_txtArea', $('#zip1 .district option:selected'));

            setDdlValue('ctl00_ContentPlaceHolder2_txtCompanyCity', $('#zip2 .county option:selected'));
            setDdlValue('ctl00_ContentPlaceHolder2_txtCompanyArea', $('#zip2 .district option:selected'));
        }

        function setTxtValue(from, targetId) {
            var selectedText = $(from).find("option:selected").val();
            $("#" + targetId).val(selectedText);
        }

        function changeImg() {
            document.getElementById("safecode").src = "captcha/Handler.ashx?" + Math.random();
        }

        function ToggleAdvProvider() {
            if ($("#AdvProviderCheck").prop('checked')) {
                $("#AdProvider").show();
            }
            else {
                $("#AdProvider").hide();
            }
        }

        function setDdlValue(fromId, target) {
            var txtValue = $("#" + fromId).val();
            $(target).text(txtValue);
        }
    </script>
    <style type="text/css">
        .zip1{display:none;}
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<asp:panel runat="server" id="pnlUI">
<div id="All-Table">
  <div id="Title-Line">
    <h2>會員資料</h2>
  </div>
    <uc1:MemberMenu ID="memberMenu" runat="server" />
  <table border="0" cellpadding="0" cellspacing="0" class="Join-Table2">
    <tr>
      <td colspan="4" class="Join-txt-red">標註 ★ 為必填項目</td>
    </tr>
    <tr>
      <td><span class="Join-txt-red">　</span>需求</td>
      <td colspan="3">
        <cc1:ExtensionCheckBoxList ID="ckbRequirement" runat="server" RepeatDirection="Horizontal">
                <asp:ListItem Value="出租鐵門">
                </asp:ListItem>
                <asp:ListItem Value="下廣告">
                </asp:ListItem>
            </cc1:ExtensionCheckBoxList>   
      </td>
    </tr>
    <tr>
      <td width="150"><span class="Join-txt-red">★</span>會員編號</td>
      <td width="408" colspan="3"><asp:Label runat="server" Text="" id="lblMemberId"></asp:Label></td>
    </tr>
    <tr>
      <td><span class="Join-txt-red">　</span>E-mail(會員帳號)</td>
      <td colspan="3"><asp:Label runat="server" Text="" id="lblLoginId"></asp:Label></td>
    </tr>
    <tr>
      <td><span class="Join-txt-red">★</span>會員名稱</td>
      <td colspan="3">
          <asp:TextBox ID="txtName" runat="server" CssClass="Join-Order" size="55"></asp:TextBox>     
        <asp:RequiredFieldValidator ID="RequiredFieldValidator21" runat="server" ErrorMessage="請輸入會員名稱"
                  ControlToValidate="txtName" Display="None" ValidationGroup="Save"></asp:RequiredFieldValidator>
      </td>
    </tr>
    <tr>
      <td><span class="Join-txt-red">★</span>聯絡電話</td>
      <td colspan="3">
          <asp:TextBox ID="txtPhone" runat="server" CssClass="Join-Order" size="55"></asp:TextBox>
          <asp:RequiredFieldValidator ID="RequiredFieldValidator24" runat="server" ErrorMessage="請輸入聯絡電話"
                  ControlToValidate="txtPhone" Display="None" ValidationGroup="Save"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ValidationGroup="Save" ErrorMessage="連絡電話格式錯誤"
                  Display="None" ValidationExpression="^\(?\d{2}\)?[\s\-]?\d{4}\-?\d{4}$" ControlToValidate="txtPhone"></asp:RegularExpressionValidator>
      </td>
    </tr>
    <tr>
      <td>　手機</td>
      <td colspan="3">
          <asp:TextBox ID="txtMobile" runat="server" CssClass="Join-Order" size="55"></asp:TextBox>
          <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" ValidationGroup="Save" ErrorMessage="手機格式錯誤"
                  Display="None" ValidationExpression="^(09)([0-9]{8})$" ControlToValidate="txtMobile"></asp:RegularExpressionValidator>
      </td>
    </tr>
    <tr>
      <td>　傳真</td>
      <td colspan="3">
          <asp:TextBox ID="txtFax" runat="server" CssClass="Join-Order" size="55"></asp:TextBox>
          <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ValidationGroup="Save" ErrorMessage="傳真格式錯誤"
                  Display="None" ValidationExpression="^\(?\d{2}\)?[\s\-]?\d{4}\-?\d{4}$" ControlToValidate="txtFax"></asp:RegularExpressionValidator>
      </td>
    </tr>
    <tr>
      <td valign="top"><span class="Join-txt-red">★</span>地址</td>
      <td colspan="3">
          <div id="zip1"></div>
          <div style="padding-top:5px;"><asp:TextBox ID="txtRoad" runat="server" CssClass="Join-Order" size="55"></asp:TextBox></div>
          <asp:TextBox ID="txtCity" runat="server" Style="display:none;"></asp:TextBox>
          <asp:TextBox ID="txtArea" runat="server" Style="display:none;"></asp:TextBox>        
          <asp:RequiredFieldValidator ID="RequiredFieldValidator25" runat="server" ErrorMessage="請輸入地址"
                  ControlToValidate="txtRoad" Display="None" ValidationGroup="Save"></asp:RequiredFieldValidator>
      </td>
    </tr>
    <tr>
      <td><span class="Join-txt-red">★</span>是否訂閱電子報</td>
      <td colspan="3">
          <asp:RadioButtonList ID="rdoReceiveEpaper" runat="server" RepeatDirection="Horizontal">
              <asp:ListItem Text="是" Value="1"></asp:ListItem>
              <asp:ListItem Text="否" Value="0"></asp:ListItem>
          </asp:RadioButtonList>
          <asp:RequiredFieldValidator ID="RequiredFieldValidator20" runat="server" ErrorMessage="請選擇是否訂閱電子報"
                  ControlToValidate="rdoReceiveEpaper" Display="None" ValidationGroup="Save"></asp:RequiredFieldValidator>
      </td>
    </tr>
    <tr>
      <td>　公司名稱</td>
      <td colspan="3"><asp:TextBox ID="txtCompany" runat="server" CssClass="Join-Order" size="55"></asp:TextBox></td>
    </tr>
    <tr>
      <td>　營利事業統一編號</td>
      <td colspan="3"><asp:TextBox ID="txtCompanyNo" runat="server" CssClass="Join-Order" size="55"></asp:TextBox></td>
    </tr>
    <tr>
      <td>　負責人</td>
      <td colspan="3"><asp:TextBox ID="txtCompanyCharge" runat="server" CssClass="Join-Order" size="55"></asp:TextBox></td>
    </tr>
    <tr>
      <td>　公司電話</td>
      <td colspan="3">
          <asp:TextBox ID="txtCompanyPhone" runat="server" CssClass="Join-Order" size="55"></asp:TextBox>
      </td>
    </tr>
    <tr>
      <td>　公司傳真</td>
      <td colspan="3">
          <asp:TextBox ID="txtCompanyFax" runat="server" CssClass="Join-Order" size="55"></asp:TextBox>
      </td>
    </tr>
    <tr>
      <td>　公司地址</td>
      <td colspan="3">
          <div id="zip2"></div>
        <div style="padding-top:5px;"><asp:TextBox ID="txtCompanyRoad" runat="server" CssClass="Join-Order" size="55"></asp:TextBox></div>
          <asp:TextBox ID="txtCompanyCity" runat="server" Style="display:none;"></asp:TextBox>
          <asp:TextBox ID="txtCompanyArea" runat="server" Style="display:none;"></asp:TextBox>
      </td>
      </tr>
    <tr>
      <td>　匯款銀行</td>
      <td colspan="3">
          <uc1:Bank ID="bank" runat="server" />
      </td>
    </tr>
    <tr>
      <td>　匯款帳戶</td>
      <td colspan="3"><asp:TextBox ID="txtBankAccount" runat="server" CssClass="Join-Order" size="55"></asp:TextBox></td>
    </tr>
    <tr>
      <td>　戶頭名稱</td>
      <td colspan="3"><asp:TextBox ID="txtBankTitle" runat="server" CssClass="Join-Order" size="55"></asp:TextBox></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td colspan="3">
        <asp:LinkButton ID="btnSave" runat="server" onclick="btnSave_Click" ValidationGroup="Save" >
        <p class="Btn-New1">修改完畢儲存</p></asp:LinkButton></td>
    </tr>
    </table>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <table border="0" cellpadding="0" cellspacing="0" class="Join-Table2">
    <tr>
      <td colspan="4" class="Join-txt-red">修改密碼</td>
      </tr>
    <tr>
      <td width="150">　輸入舊密碼</td>
      <td colspan="3">
          <asp:TextBox ID="txtOldPassword" runat="server" CssClass="Join-Order" size="55" TextMode="Password"></asp:TextBox>
          <asp:RequiredFieldValidator ID="RequiredFieldValidator42" runat="server" ErrorMessage="請輸入舊密碼"
                  ControlToValidate="txtOldPassword" Display="None" ValidationGroup="SavePassword"></asp:RequiredFieldValidator>
      </td>
    </tr>
    <tr>
      <td>　輸入新密碼</td>
      <td colspan="3">
          <asp:TextBox ID="txtNewPassword" runat="server" CssClass="Join-Order" size="55" TextMode="Password" placeholder="請輸入長度4-10碼,並包含一個英文與數字"></asp:TextBox>
          <asp:RequiredFieldValidator ID="RequiredFieldValidator32" runat="server" ErrorMessage="請輸入新密碼"
                  ControlToValidate="txtNewPassword" Display="None" ValidationGroup="SavePassword"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ValidationGroup="SavePassword" ErrorMessage="密碼格式不正確(請輸入長度4-10碼,並包含一個英文與數字)"
                  Display="None" ValidationExpression="(?=.{4,10})(?=.*[a-zA-Z])(?=.*\d).*$" ControlToValidate="txtNewPassword"></asp:RegularExpressionValidator>
      </td>
    </tr>
    <tr>
      <td>　確認新密碼</td>
      <td colspan="3">
          <asp:TextBox ID="txtCheckNewPassword" runat="server" CssClass="Join-Order" size="55" TextMode="Password"></asp:TextBox>
          <asp:RequiredFieldValidator ID="RequiredFieldValidator52" runat="server" ErrorMessage="請輸入確認新密碼"
                  ControlToValidate="txtCheckNewPassword" Display="None" ValidationGroup="SavePassword"></asp:RequiredFieldValidator>
      </td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td colspan="3"><asp:LinkButton ID="btnSavePassword" runat="server" onclick="btnSavePassword_Click" ValidationGroup="SavePassword" >
        <p class="Btn-New1">修改密碼</p>
      </asp:LinkButton></td>
    </tr>
  </table>
        </ContentTemplate>
        </asp:UpdatePanel>
</div>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="Save" 
        ShowMessageBox="True" ShowSummary="False"/>
<asp:ValidationSummary ID="ValidationSummary2" runat="server" ValidationGroup="SavePassword" 
        ShowMessageBox="True" ShowSummary="False"/>
</asp:panel>
</asp:Content>

